﻿using DoVuiKinhThanh.Domain;

namespace DoVuiKinhThanh
{
    using System.Collections.ObjectModel;

    public class QuizViewModel : GenericViewModelBase<Quiz> {
        private ViewModelObservableCollection<AnswerViewModel> m_answerVMs;
        public QuizViewModel() {
          m_answerVMs = new ViewModelObservableCollection<AnswerViewModel>();  
        }

        public string Content
        {
            get
            {
                return Model.Content;
            }
            set
            {
                if (Model.Content != value)
                {
                    Model.Content = value;
                    OnPropertyChanged(() => Content);
                }
            }
        }

        public ViewModelObservableCollection<AnswerViewModel> Answers
        {
            get
            {
                return Model.Answers;
            }
            set
            {
                if (Model.Answers != value)
                {
                    Model.Answers = value;
                    OnPropertyChanged(() => Answers);
                }
            }
        }

        internal QuizViewModel Clone()
        {
            var clonedViewModel = new QuizViewModel();
            clonedViewModel.Model = Model.Clone();
        }
    }
}
